package A20180319;

public class Account {
	int id;
	double balance;
	String dateCreated;
	
	public Account(int id, String dateCreated) {
		this.id = id;
		this.dateCreated = dateCreated;
	}
	
	public double getBalance() {
		return balance;
	}
	
	public void setBalance(double balance) {
		this.balance = balance;
	}
	
	public String getDateCreated() {
		return dateCreated;
	}
	
	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public boolean withdraw(int quantity) {
		if(quantity <= this.balance) {
			this.balance -= quantity;
			return true;
		}else {
			return false;
		}
	}
	
	public void deposit(int quantity) {
		this.balance += quantity;
	}

}
